﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Admin_ThemHinhAnh : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnUp_Click(object sender, EventArgs e)
    {
        bool flag = false;

        if (upload.HasFile)
        {
            HttpFileCollection hfc = Request.Files;
            string list = "";
            string path = Server.MapPath("~\\Admin\\img\\Items\\");

            for (int i = 0; i < hfc.Count; i++)
            {
                HttpPostedFile hpf = hfc[i];
                if (hpf.ContentLength > 0)
                {
                    hpf.SaveAs(path + hpf.FileName);
                    list += hpf.FileName + ",";
                }

                string s = list.Substring(0, list.Length - 1);
                String[] listImg = s.Split(',');
                Session["ImageView"] = s;

            }

            flag = true;
        }
        if (flag)
        {
            ScriptManager.RegisterStartupScript(btnUp, btnUp.GetType(), "ScriptLoginSuccess", "UpdateParentsLogin();", true);
        }
    }
}
